Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_wifi: Fix TX de-init crash #1277

Merged
merged 5 commits into from
Jun 3, 2024
Merged

Conversation

krish2718
Copy link
Contributor

@krish2718 krish2718 commented Apr 1, 2024

If interface is de-initialized during active traffic, then the HAL RX lock still doesn't protect the full de-initialization path, there is a race after TX de-init, lock is released and before the FMAC context is de-initialized the NULL checks elsewhere pass and can lead to crashes.

Add an atomic API that does both de-initialization and removal by taking the HAL RX lock for both operations, this way FMAC context is freed and NULL checks should avoid any crashes.

Fixes SHEL-2436.

@krish2718 krish2718 marked this pull request as draft April 1, 2024 19:08
@krish2718 krish2718 marked this pull request as ready for review May 30, 2024 16:37
@krish2718 krish2718 added this to the 2.7.0 milestone May 30, 2024
@krish2718 krish2718 added the manifest-pr-skip Skips automatic manifest PR creation label May 30, 2024
Interrupts should be disabled early to avoid further events coming up
the driver.

Signed-off-by: Chaitanya Tata <[email protected]>
The HAL status is used internally, but the API was never called, so,
hook up the API to dev init/deinit.

Signed-off-by: Chaitanya Tata <[email protected]>
Draining should be done early to avoid any event handlers being called
after, also, remove the check for HAL status, as drain doesn't invoke
the event handlers, this fixes the memory leak.

Signed-off-by: Chaitanya Tata <[email protected]>
Use the unused HAL de-init API before proceeding with FMAC de-init, this
way we can move the entire logic and locking to HAL de-init, so, remove
the HAL locks in FMAC.

Signed-off-by: Chaitanya Tata <[email protected]>
In current SAP implementation based on a single VIF, we modify the VIF
type from STA->AP and vice-versa, so, call the API to update the counts
properly.

The counts are crucial to remove the RPU during interface down.

Signed-off-by: Chaitanya Tata <[email protected]>
@rlubos rlubos merged commit 589238f into nrfconnect:main Jun 3, 2024
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
manifest-pr-skip Skips automatic manifest PR creation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants